<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
// 什么是promise ?  es6 解决异步任务 
// 代码编写顺序和执行顺序不一致的统一方案
// callback 回调有缺点
const weather = new Promise((resolve, reject) => {
    setTimeout(() => {
        resolve({'a':1})
    }, 2000)
});
weather
    .then((data) => {
        console.log(data)
    })
</script>
</body>
</html>